<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Paper extends Model
{

    public $timestamps = false;
    protected $connection = 'xz';
    protected $table = 'paper';
    use HasFactory;
    
    /**
     *  获取日期.
     *
     * @param string $value
     * @return string
     */
    public function getCreateTimeAttribute(string $value)
    {
        return Date("Y-m-d H:i:s",$value);
    }
    
    public function _type()
    {
        return $this->hasOne('App\Models\PaperClass','id','cid')->select('id','title');
    }

}
